$.easing.elasout = function(x, t, b, c, d) {
    var s=1.70158;var p=0;var a=c;
    if (t==0) return b;  if ((t/=d)==1) return b+c;  if (!p) p=d*.3;
    if (a < Math.abs(c)) { a=c; var s=p/4; }
    else var s = p/(2*Math.PI) * Math.asin (c/a);
    return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
};

$('a.back').click(function(){
    $(this).parents('div.pane').scrollTo( 0, 800, { queue:true } );
    $(this).parents('div.section').find('span.message').text( this.title );
    return false;
});

$('#menu-equipment').click(function() {
    $.scrollTo( '#active-equipment', 1000, {easing:'elasout'});
    $('#active-equipment').effect("highlight", {}, 3000);
});

$('#menu-actions').click(function() {
    $.scrollTo( '#quick', 1000, {easing:'elasout'});
    $('#quick').effect("highlight", {}, 3000);
});

$('#menu-forms').click(function() {
    $.scrollTo( '#forms', 1000, {easing:'elasout'});
    $('#forms').effect("highlight", {}, 3000);
});

$('#menu-preferences').click(function() {
    $.scrollTo( '#preferences', 1000, {easing:'elasout'});
    $('#preferences').effect("highlight", {}, 3000);
});

$(document).ready ( function () {
    $.scrollTo(location.hash, 1000, {easing:'elasout'});
    jQuery(location.hash).addClass('highlight');
});
